#include "stdafx.h"
#include "Bincode.h"
#include "IFile.h"
#include "OFile.h"


using namespace std;

int main() {
    IFile code("my1.asm");
    OFile binary("my1.txt");
    if (code.isOpen() && binary.isOpen()) {
      int lineNumber = 0;
      cout << "Open file." << endl;
      do {
        Bincode bincode(code.readline());
        binary.writeLine(to_string(1000 + 4 * lineNumber++) + ": " +
                         bincode.type1() + "\t" + bincode.type2());
      } while (!code.eof());
      cout << "Total:" << lineNumber << " lines assembled." << endl;
    } 
  return 0;
}
